package com.bwie.controller;

import com.bwie.pojo.Result;
import com.bwie.pojo.dto.RegistrationDto;
import com.bwie.pojo.vo.RegistrationVo;
import com.bwie.service.RegistrationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @ 挂号
 * @descriptions: RegistrationController
 * @author: LiYang
 * @date: 2025/3/14 15:42
 * @version: 1.0
 */
@Controller
@RequestMapping("registration")
public class RegistrationController {
    @Autowired
    private RegistrationService registrationService;

    /**
     * 挂号页面
     * @return
     */
    @RequestMapping("toList")
    public String toList(){
        return "registration/list";
    }

    /**
     * 挂号列表
     * @param registrationDto
     * @return
     */
    @RequestMapping("getList")
    @ResponseBody
    public Result getList(RegistrationDto registrationDto){
        return registrationService.getList(registrationDto);
    }
    /**
     * 添加页面
     * @return
     */
    @RequestMapping("toAdd")
    public String toAdd(){
        return "registration/add";
    }

    /**
     * 添加方法
     * @param registrationVo
     * @return
     */
    @RequestMapping("getAdd")
    @ResponseBody
    public Result getAdd(@RequestBody RegistrationVo registrationVo){
        return registrationService.getAdd(registrationVo);
    }
    /**
     * 添加页面
     * @return
     */
    @RequestMapping("toSet")
    public String toSet(){
        return "registration/toSet";
    }
}
